package com.hoppinzq.config;

import io.github.bonigarcia.wdm.WebDriverManager;
import io.github.bonigarcia.wdm.config.DriverManagerType;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class SeleniumConfig {
    @Value("${selenium.browser.driverPath}")
    private String driverPath;
    @Value("${selenium.browser.type}")
    private String browserType;
    @Bean
    public WebDriver getWebDriver() {
        WebDriverManager.getInstance(DriverManagerType.valueOf(browserType)).setup();
        return new ChromeDriver();
    }
}